
from typing import List


def relocateMarbles(nums: List[int], moveFrom: List[int], moveTo: List[int]) -> List[int]:
    res = []
    map = {}
    for num in nums:
        map[num] = True 
    for i in range(len(moveFrom)):
        if moveFrom[i] in map:
            del map[moveFrom[i]]
        map[moveTo[i]] = True 
    for key in map:
        res.append(key)
    res.sort()
    return res

nums = [1,6,7,8]
moveFrom = [1,7,2]
moveTo = [2,9,5]
res = relocateMarbles(nums,moveFrom,moveTo)
print("res:",res)